﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Practices.Unity;
using Skynet.LiteFoundation.BusinessEntities;

namespace Skynet.LiteAdministration.Views.MaintenanceExamCategories
{
    /// <summary>
    /// Interaction logic for MaintenanceExamCategoriesView.xaml
    /// </summary>
    public partial class MaintenanceExamCategoriesView : UserControl,  IMaintenanceCategoriesView
    {
        private MaintenanceExamCategoryPresenter _Presenter;

        [Dependency]
        public MaintenanceExamCategoryPresenter Presenter
        {
            get { return _Presenter; }
            set { 
                _Presenter = value;
                _Presenter.View = this; 
                this.DataContext = value; 
            }
        }
        
       

        public MaintenanceExamCategoriesView()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //this.Presenter.Add(new ExamCategory() { Id = Guid.NewGuid(), Title = this.txtTItle.Text, Description = this.txtDescription.Text });

            this.Presenter.Save();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            this.Presenter.OnViewReady(); 
        }
    }
}
